//
//  RadioViewButtonView.m
//  SunXi
//
//  Created by dllo on 15/11/28.
//  Copyright © 2015年 大远. All rights reserved.
//

#import "RadioViewButtonView.h"

@implementation RadioViewButtonView
- (instancetype)init{
    if (self = [super init]) {
        [self creareDraw];
    }
    return self;
}

- (void)creareDraw{
    
    UIButton *play = [UIButton buttonWithType:UIButtonTypeSystem];
    [self addSubview:play];
    [play setTintColor:[UIColor blackColor]];
    [play setImage:[UIImage imageNamed:@"stop"] forState:UIControlStateNormal];
    [play mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(35, 35));
        make.centerX.and.centerY.equalTo(self);
    }];
    [play addTarget:self action:@selector(clickplay:) forControlEvents:UIControlEventTouchUpInside];

   
    
    
    
    UIButton *next = [UIButton buttonWithType:UIButtonTypeSystem];
    [self addSubview:next];
    [next setTintColor:[UIColor blackColor]];
    [next setImage:[UIImage imageNamed:@"next"] forState:UIControlStateNormal];
    [next mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(25, 25));
        make.centerY.equalTo(self);
        make.right.equalTo(self).offset(-60);
    }];
    
    [next addTarget:self action:@selector(clicknext) forControlEvents:UIControlEventTouchUpInside];
    
    UIButton *last = [UIButton buttonWithType:UIButtonTypeSystem];
    [last setTintColor:[UIColor blackColor]];
    [self addSubview:last];
    [last setImage:[UIImage imageNamed:@"last"] forState:UIControlStateNormal];
    [last mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(25, 25));
        make.centerY.equalTo(self);
        make.left.equalTo(self).offset(60);
    }];
    
    [last addTarget:self action:@selector(clicklast) forControlEvents:UIControlEventTouchUpInside];
    
    
}

- (void)clickplay:(UIButton *)button{
    [self.delegate play:button];
}

- (void)clicknext{
    [self.delegate next];
}
- (void)clicklast{
    [self.delegate last];
}
@end
